/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Service;

import DAO.CompanyDAO;
import Entity.Company;
import VO.CompanyVO;
import javax.persistence.EntityManager;

/**
 *
 * @author usuario
 */
public class CompanyService {
    
     public void persistCompany(CompanyVO vo, EntityManager em){
        Company entityAdmin = new Company();
        entityAdmin.setId(vo.getIdCompany());
        entityAdmin.setNameCompany(vo.getNameCompany());
        entityAdmin.setSymbolCompany(vo.getSymbolCompany());
        entityAdmin.setDescriptionCompany(vo.getDescriptionCompany());
        

        CompanyDAO.persistCompany(entityAdmin, em);
    }
     
     public void removeCompany(CompanyVO vo, EntityManager em){
         Company entityAdmin = new Company();
        entityAdmin.setId(vo.getIdCompany());
        entityAdmin.setNameCompany(vo.getNameCompany());
        entityAdmin.setSymbolCompany(vo.getSymbolCompany());
        entityAdmin.setDescriptionCompany(vo.getDescriptionCompany());
         CompanyDAO.removeCompany(entityAdmin,em);
     }
     
     
    
}
